﻿<div class="icons">
    @Html.Action("ReadForType", "Attachment", new { VPartial = "ReadForIcon", TypeKey = "Common_Icon" })
</div>
<style>
    .icons  { width:600px;  }
    .icons img { padding: 5px; cursor: pointer; }
    .icons img.selected { padding: 4px; border: 1px solid #5080D8; }
</style>
<script>
    $(function ()
    {
        $(".icons img").each(function (i)
        {
            if ($(this).attr("src") == $("#IconUrl").val())
            {
                $(this).addClass("selected");
            }
        });

        $(".icons img").click(function ()
        {
            $(".icons img").removeClass("selected");
            $(this).addClass("selected");
            $("#IconUrl").val($(this).attr("src"));
        });
    });
</script>
